<!-- 父组件 ParentComponent.vue 动态生成列表信息-->
<template>
  <ActiveTable
    :columns="tableColumns"
    :data="tableData"
  />
</template>

<script setup lang="ts">
import ActiveTable from './ActiveTable.vue'
import { ref } from 'vue'

// 列配置
const tableColumns = ref([
  { prop: 'id', label: '序号' },
  { prop: 'code', label: '商品编码' },
  { prop: 'name', label: '商品名称' },
  { prop: 'kname', label: '商品分类' },
  { prop: 'uname', label: '单位' },
  { prop: 'status', label: '审核状态' },
  { prop: 'tax', label: '税率' },
  { prop: 'store', label: '仓库' }

])

// 表格数据
const tableData = ref([
  {
    id: '1',
    code: 'good_1',
    name: '红米K70',
    kname: '手机',
    uname: '个',
    tax: '3%',
    status: '已审核',
    store: '电子仓库',
  },
  {
    id: '2',
    code: 'good_2',
    name: '鸡蛋',
    kname: '农产品',
    uname: '个',
    tax: '3%',
    status:'未审核',
    store: '农业仓库',
  },
  {
    id: '3',
    code: 'good_3',
    name: '水泥',
    kname: '建筑材料',
    uname: '斤',
    tax: '5%',
    status:'已审核',
    store: '建筑仓库',
  },
  {
    id: '4',
    code: 'good_4',
    name: '电动车',
    kname: '交通工具',
    uname: '辆',
    tax: '12%',
    status:'已审核',
    store: '交通仓库',
  },
])
</script>
